package hmvictor.jpql.types;

import java.util.Objects;

/**
 *
 * @author Victor
 */
public abstract class AbstractParameterType<T> implements ParameterType<T>{
    private final String name;

    public AbstractParameterType(String name) {
        this.name = name;
    }
    
    @Override
    public String getName() {
        return name;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 19 * hash + Objects.hashCode(this.name);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AbstractParameterType<?> other = (AbstractParameterType<?>) obj;
        if (!Objects.equals(this.name, other.name)) {
            return false;
        }
        return true;
    }
    
}
